package framework;

import java.util.Vector;

/**
 * This class models a folder.
 *
 */
public class Folder extends FolderItem {
	/**
	 * A collection of folder items for this folder.
	 */
	private Vector<FolderItem> folderItems;

	/**
	 * Construct a <code>Folder</code> object.
	 * by using the constructor of <code>FolderItem</code>.
	 * @param initialName the name of the folder.
	 */
	public Folder(String initialName) {
		super(initialName);
		folderItems = new Vector<FolderItem>();

	}

	/**
	 * Get the collection of folder items for this folder.
	 * @return the collection of the folder items.
	 */
	public Vector<FolderItem> getFolderItems() {
		return folderItems;
	}

	/**
	 * Set a new collection of folder items for this folder.
	 * @param newFolderItems the new collection of folder items for this folder.
	 */
	public void setFolderItems(Vector<FolderItem> newFolderItems) {
		folderItems = newFolderItems;
	}

	/**
	 * Add a folder item into this folder.
	 * @param item the item the user wants to add into this folder.
	 */
	public void addFolderItem(FolderItem item) {
		folderItems.add(item);
	}

	/**
	 * Remove a specific folder item of this folder.
	 * @param item the folder item the user wants to remove.
	 */
	public void removeFolderItem(FolderItem item) {
		folderItems.remove(item);
	}

	/**
	 * Get a specific folder item according to the number of the input.
	 * @param index the number corresponding to the specific folder item.
	 * @return the specific folder item according to the number.
	 */
	public FolderItem getFolderItem(int index) {
		return folderItems.get(index);
	}

	/**
	 * Get the total number of folder items in this folder.
	 * @return the total number of the folder items in this folder.
	 */
	public int getNumberOfFolderItems() {
		return folderItems.size();
	}
}
